﻿using System;
using System.Collections.Generic;
using System.Text;
using HotelManagement.Common;
using HotelManagement.DL.DAO;

namespace HotelManagement.BL
{
    public class GoodsBL
    {
        public int Search(ref Goods goods)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                GoodsDL searchGoodsDL = new GoodsDL();
                nResult = searchGoodsDL.Search(ref goods);
            }
            catch
            {
                throw;
            }

            return nResult;
        }

        public int SearchWarnGoods(ref Goods goods)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                GoodsDL searchGoodsDL = new GoodsDL();
                nResult = searchGoodsDL.SearchWarnGoods(ref goods);
            }
            catch
            {
                throw;
            }

            return nResult;
        }

        public int SaleGoods(Goods goodsInfo, Trade tradeInfo)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                GoodsDL GoodsDL = new GoodsDL();
                nResult = GoodsDL.SaleGoods(goodsInfo, tradeInfo);
            }
            catch
            {
                throw;
            }

            return nResult;
        }

        public int PurchaseGoods(Goods goodsInfo, Trade tradeInfo)
        {
            int nResult = (int)ReturnType.FAILED;
            try
            {
                GoodsDL GoodsDL = new GoodsDL();
                nResult = GoodsDL.PurchaseGoods(goodsInfo, tradeInfo);
            }
            catch
            {
                throw;
            }

            return nResult;
        }
    }
}
